function organizationDetailsCtrl($scope,$http,$location,$stateParams){
	$scope.saveLogo = function (){
		$scope.logo = $scope.image2.file;
		$http.post('organization/'+$stateParams.id+'/setLogo', $scope.logo).success(function(data) {
			console.log(data);
		});
	};
	
	$scope.updateLogo = function() {
        var fd = new FormData();
        fd.append("uploadedFile", $scope.image2.file);
        
        var xhr = new XMLHttpRequest();
      /*  xhr.upload.addEventListener("progress", uploadProgress, false);
        xhr.addEventListener("load", uploadComplete, false);
        xhr.addEventListener("error", uploadFailed, false);
        xhr.addEventListener("abort", uploadCanceled, false);*/
        xhr.open("POST", 'organization/'+$stateParams.id+'/setLogo');
        //scope.progressVisible = true;
        xhr.send(fd);
    };
	
	$scope.saveDetails = function () {
		var data = {"id":$scope.orgData.id,"title":$scope.orgData.title,"description":$scope.orgData.description};
		$http.post('organizations', data).success(function(data) {
			
		});
	};
	
	$scope.getDetails = function () {
		$http.get('organization/'+$stateParams.id).success(function(data) {
			$scope.orgData = data;
		});
	};
	$scope.getDetails();
}

organizationDetailsCtrl.$inject = ['$scope','$http','$location','$stateParams'];//inject required